/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.javeriana.aes.psw.gui.helper;

import java.awt.BasicStroke;
import java.awt.Color;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.ThermometerPlot;
import org.jfree.data.general.DefaultValueDataset;

public class ChartPanelHelper {


    public static ChartPanel getTermometroPlot(String leyenda,Double temperatura) {

        DefaultValueDataset dataset;
        ThermometerPlot plot ;
        JFreeChart chart ;

        dataset = new DefaultValueDataset(temperatura);
        plot = new ThermometerPlot(dataset);
        chart = new JFreeChart(leyenda,JFreeChart.DEFAULT_TITLE_FONT,plot,false);

        plot.setThermometerStroke(new BasicStroke(2.0f));
        plot.setThermometerPaint(Color.lightGray);

        ChartPanel chartPanel = new ChartPanel(chart);
        return chartPanel;

    }
}
